package com.bwhx.eruler.dao.impl;

import java.util.ArrayList;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.bwhx.eruler.bean.CScanData;
import com.bwhx.eruler.bean.ChangeVersion;
import com.bwhx.eruler.bean.Customer;
import com.bwhx.eruler.bean.Order;
import com.bwhx.eruler.bean.OrderBack;
import com.bwhx.eruler.bean.Page;
import com.bwhx.eruler.bean.Ruler;
import com.bwhx.eruler.dao.ChangeVersionDao;
import com.bwhx.eruler.dao.OrderDao;

/**
 * @Description:
 */
@Repository
public class ChangeVersionDaoImpl extends BaseDaoImpl<ChangeVersion> implements ChangeVersionDao {
	public ChangeVersionDaoImpl() {
		this.setNs("com.bwhx.eruler.mapper.ChangeVersionMapper.");
	}

	//TODO 关系是多对多，先不建关联了
	@Override
	public void insert(ChangeVersion cv, List<Ruler> rulers) {
		insert(cv);
	
		this.getSqlSession().update("com.bwhx.eruler.mapper.RulerMapper." + "updaterulerbychangeversion", rulers);
	
		
	}

	@Override
	public List<ChangeVersion> list(Page p) {
		
		return getSqlSession().selectList("com.bwhx.eruler.mapper.ChangeVersionMapper." + "list",p);

	}

	@Override
	public Integer count(ChangeVersion cv) {
		Object selectOne = getSqlSession().selectOne("com.bwhx.eruler.mapper.ChangeVersionMapper." + "count",cv);
		if(null!=selectOne && selectOne instanceof Integer){
			return (int)selectOne;
		}
		return 0;
	}
	
	/**
	 * 	@Override
	public List<OrderBack> list(Page p) {
		return getSqlSession().selectList("com.bwhx.eruler.mapper.OrderBackMapper." + "list",p);
	}

	@Override
	public Integer count(OrderBack ob) {
		Object selectOne = getSqlSession().selectOne("com.bwhx.eruler.mapper.OrderBackMapper." + "count",ob);
		if(null!=selectOne && selectOne instanceof Integer){
			return (int)selectOne;
		}
		return 0;
	}
	 */


	/*public List<Order> findByName(String ordername) {
	
		return getSqlSession().selectList("com.bwhx.eruler.mapper.OrderMapper." + "findByName", ordername);
	}


	

	@Override
	public void inputOrder(Order d) {
		this.getSqlSession().update("com.bwhx.eruler.mapper.OrderMapper." + "updateruler", d);
		
		
	}*/

	
	
}
